//
//  PurchasePicInformationViewModel.m
//  GLGW_Shoping
//
//  Created by yang on 2018/12/12.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "PurchasePicInformationViewModel.h"
#import "PurchasePictureTableViewCell.h"
#import "ConfirmTopTimeView.h"
#import "PurchasePictureBottomView.h"

@interface PurchasePicInformationViewModel ()<UITableViewDelegate,UITableViewDataSource>

@end

@implementation PurchasePicInformationViewModel

-(instancetype)initWithViewToViewModel:(UITableView *)tableView theSuperView:(UIView *)superView{
    if (self = [super initWithViewToViewModel:tableView theSuperView:superView]) {
        tableView.y = tableView.y + kHeightProportion_In_iPhoneTriploid(34);
        tableView.height = tableView.height - kHeightProportion_In_iPhoneTriploid(94);
        tableView.mj_header.hidden = YES;
        tableView.mj_footer.hidden = YES;
        tableView.delegate = self;
        tableView.dataSource = self;
        tableView.estimatedRowHeight = 100;
        tableView.rowHeight = UITableViewAutomaticDimension;
        tableView.tableFooterView = [self createFootView];
        [superView addSubview:tableView];
        //
        ConfirmTopTimeView * confirmView = [[ConfirmTopTimeView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, kHeightProportion_In_iPhoneTriploid(30)) inSuperView:superView];
        //
        PurchasePictureBottomView * pictureView = [[PurchasePictureBottomView alloc] initWithFrame:CGRectMake(0, kY_With_View(tableView, 0), KScreenWidth, kHeightProportion_In_iPhoneTriploid(60)) inSuperView:superView];
    }
    return self;
}

-(UIView *)createFootView{
    UIView * footview = [[UIView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, kHeightProportion_In_iPhoneTriploid(10))];
    footview.backgroundColor = [UIColor colorWithHexString:@"#F2F2F2"];
    return footview;
}

#pragma mark -- UITableViewDelegate,UITableViewDataSource

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 1;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    PurchasePictureTableViewCell * cell = [PurchasePictureTableViewCell cellWithTableView:tableView];
    return cell;
}
@end
